home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / bluez-alsa.preinst < prev    next >
Text File  |  2009-09-24  |  888b  |  31 lines

  1. #!/bin/sh -e
  2.  
  3. # snippet from http://wiki.debian.org/DpkgConffileHandling
  4.  
  5. # Remove a no-longer used conffile
  6. rm_conffile() {
  7.     PKGNAME="$1"
  8.     CONFFILE="$2"
  9.     if [ -e "$CONFFILE" ]; then
  10.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  11.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
  12.         if [ "$md5sum" != "$old_md5sum" ]; then
  13.             echo "Obsolete conffile $CONFFILE has been modified by you."
  14.             echo "Saving as $CONFFILE.dpkg-bak ..."
  15.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  16.         else
  17.             echo "Removing obsolete conffile $CONFFILE ..."
  18.             rm -f "$CONFFILE"
  19.         fi
  20.     fi
  21. }
  22.  
  23. case "$1" in
  24. install|upgrade)
  25.     if dpkg --compare-versions "$2" le "3.24-1+b1"; then
  26.         rm_conffile bluez-audio "/etc/bluetooth/audio.service"
  27.     fi
  28. esac
  29.  
  30.  
  31.